[alert] Remove deprecated props#47965
Merged
silviuaavram merged 2 commits intomui:masterfrom Mar 16, 2026
Merged
Conversation
Netlify deploy previewBundle size report
|
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the deprecated components / componentsProps API from Alert in MUI Material, aligning the component with the slots / slotProps customization model and updating related tests/types/docs for v9.
Changes:
- Removed
componentsandcomponentsPropshandling frompackages/mui-material/src/Alert/Alert.jsand from the public TypeScript types. - Updated
Alerttests to useslots/slotPropsfor close button/icon customization. - Updated API docs JSON + added a v9 migration note documenting the removed props.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/mui-material/src/Alert/Alert.js | Removes deprecated prop support and simplifies forwarded slot configuration. |
| packages/mui-material/src/Alert/Alert.d.ts | Drops deprecated props from the public TS surface. |
| packages/mui-material/src/Alert/Alert.test.js | Updates tests to exercise slots/slotProps for close button/icon. |
| docs/translations/api-docs/alert/alert.json | Removes deprecated prop entries from translated API docs. |
| docs/pages/material-ui/api/alert.json | Removes deprecated prop entries from generated API JSON. |
| docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md | Documents the Alert deprecations removal and shows the replacement API. |
Comments suppressed due to low confidence (1)
packages/mui-material/src/Alert/Alert.js:175
- By removing
componentsandcomponentsPropsfrom the destructured props, any consumer still passing these (or having them in themedefaultProps) will leave them inside...otherand they will be forwarded to therootslot viauseSlot(as DOM attributes on the underlying element), causing React unknown-prop warnings and invalid HTML. Even if the props are removed from the public API, they should be explicitly omitted fromother(e.g. destructure them into unused variables) so they are not spread to the root slot.
const Alert = React.forwardRef(function Alert(inProps, ref) {
const props = useDefaultProps({ props: inProps, name: 'MuiAlert' });
const {
action,
children,
className,
closeText = 'Close',
color,
icon,
iconMapping = defaultIconMapping,
onClose,
role = 'alert',
severity = 'success',
slotProps = {},
slots = {},
variant = 'standard',
...other
} = props;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
3f59e9a to
e78fb7c
Compare
siriwatknp
reviewed
Mar 16, 2026
36 tasks
siriwatknp
approved these changes
Mar 16, 2026
ZeeshanTamboli
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.